﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace TyNetCoreBlog.Models.Entities
{
    public class Tag
    {

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "标签名称")]
        public string Name { get; set; }

        public virtual ICollection<BlogTag> BlogTags { get; set; } = new List<BlogTag>();   //关联中间表
    }
}
